<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <link rel="stylesheet" type="text/css" href="./css/layui.css">
</head>
<body>
    <form class="layui-form" style="width:300px;padding-top: 80px;">
        <div class="layui-form-item">
            <label class="layui-form-label">用户名</label>
            <div class="layui-input-block">
                <input type="text" lay-verify="" class="layui-input" name="username">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">手机</label>
            <div class="layui-input-block">
                <input type="text" lay-verify="" class="layui-input" name="phone">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">邮箱</label>
            <div class="layui-input-block">
                <input type="text" lay-verify="" class="layui-input" name="email">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">性别</label>
            <div class="layui-input-block">
                <input type="radio" class="layui-input" name="sex" title="男">
                <input type="radio" class="layui-input" name="sex" title="女">
            </div>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label">开关</label>
          <div class="layui-input-block">
            <input type="checkbox" name="switch" lay-skin="switch" lay-text="ON|OFF" lay-filter="switchTest" value="1"><div class="layui-unselect layui-form-switch layui-form-onswitch" lay-skin="_switch"><em>ON</em><i></i></div>
          </div>
        </div>
        <div class="layui-form-item">
             <label class="layui-form-label"></label>
            <button class="layui-btn" lay-submit lay-filter="save">提交</button>
        </div>
        
    </form>
    <script type="text/javascript" src="./layui.js"></script>
    <script>
        //Demo
        layui.use('form', function(){
          var form = layui.form;
          
          //监听提交
          form.on('submit(save)', function(data){
            // layer.alert('内容');
            // layer.confirm('xxxx');
            // layer.msg('xxx',{icon: 1});

            // layer.msg('玩命卖萌中', function(){});
            // 
            layer.open({
              type: 1,
              title: false,
              closeBtn: 0,
              shadeClose: true,
              skin: 'yourclass',
              content: '<p>sdfsdf</p><p>sdfsdf</p><p>sdfsdf</p><p>sdfsdf</p><p>sdfsdf</p><p>sdfsdf</p><p>sdfsdf</p>'
            });

            return false;
          });
        });
</script>
</body>
</html>